home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / hardware / cpu115 / p5info.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-02-27  |  2.9 KB  |  109 lines

  1. { ---------------------------------------------------------------------------- }
  2. { P5INFO.PAS  Intel P5 and like CPU feature lister          Version 1.03 }
  3. {                                           }
  4. { Copyright(c) 1994,95 by B-coolWare.  Written by Bobby Z.               }
  5. { ---------------------------------------------------------------------------- }
  6. {
  7.   Files needed to build project:
  8.  
  9.   HEADER.ASH    - assembler header file
  10.   P5INFO.ASM    - low-level routines
  11.   P5INFO.PAS     - this file
  12.  
  13.   How to build:
  14.  
  15.   Assemble P5INFO.ASM with TASM 2.0 or any other compatible assembler (check
  16.   memory model in HEADER.ASH before assembling!), then compile P5INFO.PAS with
  17.   Turbo/Borland or Stony Brook Pascal compiler.
  18.  
  19. }
  20. {$S-,I-,V-,X+}
  21. program P5Info;
  22.  
  23. const
  24.       FPUonChip         = $0001;
  25.       EnhancedV86       = $0002;
  26.       IOBreakpoints     = $0004;
  27.       PageSizeExtensions= $0008;
  28.       TimeStampCounter  = $0010;
  29.       ModelSpecificRegs = $0020;
  30.       MachineCheckExcept= $0080;
  31.       CMPXCHG8B         = $0100;
  32.       APIConChip    = $0200;
  33.  
  34.       Family            = $0F00;
  35.       Model             = $00F0;
  36.       Step              = $000F;
  37.  
  38. function CheckP5 : Word; far; external;
  39.  
  40. function GetP5Features : Word; far; external;
  41.  
  42. function GetP5Vendor : String; far; external;
  43.  
  44. {$L P5INFO}
  45.  
  46. function GetFamily : Word;
  47.  begin
  48.   GetFamily := (CheckP5 and Family) shr 8;
  49.  end;
  50.  
  51. function GetModel : Word;
  52.  begin
  53.   GetModel := (CheckP5 and Model) shr 4;
  54.  end;
  55.  
  56. function GetStep : Word;
  57.  begin
  58.   GetStep := (CheckP5 and Step);
  59.  end;
  60.  
  61. procedure PrintBullet( doPrint : Word );
  62.  begin
  63.   if doPrint <> 0 then
  64.    Write(#254)
  65.   else
  66.    Write(' ');
  67.  end;
  68.  
  69. procedure PrintFeatures;
  70.  var P5Features : Word;
  71.  begin
  72.   P5Features := GetP5Features;
  73.   PrintBullet(P5Features and FPUonChip);
  74.   WriteLn(' FPU on Chip');
  75.   PrintBullet(P5Features and EnhancedV86);
  76.   WriteLn(' Enhanced Virtual-8086 mode');
  77.   PrintBullet(P5Features and IOBreakpoints);
  78.   WriteLn(' I/O Breakpoints');
  79.   PrintBullet(P5Features and PageSizeExtensions);
  80.   WriteLn(' Page Size Extensions');
  81.   PrintBullet(P5Features and TimeStampCounter);
  82.   WriteLn(' Time Stamp Counter');
  83.   PrintBullet(P5Features and ModelSpecificRegs);
  84.   WriteLn(' Pentium processor-style model specific registers');
  85.   PrintBullet(P5Features and MachineCheckExcept);
  86.   WriteLn(' Machine Check Exception');
  87.   PrintBullet(P5Features and CMPXCHG8B);
  88.   WriteLn(' CMPXCHG8B Instruction');
  89.   PrintBullet(P5Features and APIConChip);
  90.   WriteLn(' APIC on chip');
  91. end;
  92.  
  93.  
  94. begin
  95.  WriteLn('P5Info/Pas  Version 1.03  Copyright(c) 1994,95 by B-coolWare.');
  96.  WriteLn;
  97.  if CheckP5 = 0 then
  98.   begin
  99.    WriteLn('This processor doesn''t handle CPUID instruction properly.');
  100.    Halt;
  101.   end;
  102.  
  103.  WriteLn('Make ',GetP5Vendor);
  104.  WriteLn('Family ',GetFamily,', Model ',GetModel,', Step ',GetStep);
  105.  WriteLn;
  106.  WriteLn('Processor Features:');
  107.  PrintFeatures;
  108. end.
  109.